def insert_search(array, n):
    left=0
    right=len(array)-1
    while left <=right:
        mid=left+(n-array[left])*(right-left)//(array[right]-array[left])
        if mid < 0 or mid >= len(array):
            return -1
        if array[mid] == n:
            return mid
        if array[mid] > n:
            right=mid
        if array[mid] < n:
            left=mid
    return -1
